import { BaseModel } from '@/common/base/base.model';
import { Column, Entity, JoinColumn, ManyToOne } from 'typeorm';
import { EvaluationModel } from "@/module/evaluation/evaluation.model";

@Entity('EVALUATION_FILE', {
  synchronize: false,
}) // 评测项目文件
export class EvaluationFileModel extends BaseModel {
  @Column({
    comment: '评测uuid',
    type: 'uuid',
  })
  evaluationUuid: string;
  @ManyToOne(() => EvaluationModel, {
    createForeignKeyConstraints: false,
  })
  @JoinColumn({
    name: 'evaluation_uuid',
    referencedColumnName: 'uuid',
  })
  evaluation: EvaluationModel;

  @Column({
    comment: '分组',
    type: 'varchar',
    length: 200,
    nullable: true,
    default: null,
  })
  group: string;

  @Column({
    comment: '文件',
    type: 'varchar',
    length: 200,
    default: '',
  })
  url: string;

  @Column({
    comment: '序号',
    type: 'smallint',
    default: 0,
  })
  sort: number;
}
